fix(cli): resolve 6 bugs found during E2E testing#110
Merged
Conversation
- datasets create: add missing -o/--output flag; move banner to stderr
- sandbox new: move "Sandbox created" banner to stderr so -o json is parseable
- sandbox read: use println! instead of print! to ensure trailing newline
- sandbox: add delete subcommand (DELETE /sandboxes/{id})
- workspaces set: check HOTDATA_SANDBOX instead of HOTDATA_WORKSPACE; update error message
- context push: surface friendly hint when server blocks push inside an active sandbox
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Review
Blocking Issues
src/sandbox.rs:343—sandbox deletedoes not clear the cached sandbox session or theconfig.sandboxpointer when the deleted sandbox is the active one. Aftersandbox new→sandbox delete <id>, subsequent commands keep using the now-stale sandbox JWT and surface confusing API errors until the user manually runssandbox set(no args).
Action Required
- In
sandbox::delete, after a successful DELETE, check whether the deleted id is the active sandbox (config::load("default")?.sandbox) and, if so, callsandbox_session::clear()andconfig::clear_sandbox("default")— mirroring the cleanupsandbox::set(None, ..)already does.
- sandbox update: move "Sandbox updated" banner to eprintln! (stderr) so -o json stdout is clean — same fix as sandbox new - scripts/test_commands.sh: new comprehensive functional test script covering all 128 command/subcommand/flag/output-format combinations, with real API calls, resource lifecycle, and cleanup
Contributor
There was a problem hiding this comment.
Review
Blocking Issues
src/sandbox.rs:343—sandbox deletestill does not clear the cached sandbox session orconfig.sandboxwhen the deleted id is the active one. This was flagged as blocking in cycle 1 and has not been addressed; subsequent commands will keep routing through a sandbox JWT for a server-side-deleted sandbox until the user manually runssandbox set.
Action Required
- After the successful DELETE in
sandbox::delete, load the active sandbox fromconfig::load("default")and, if it matchessandbox_id, callsandbox_session::clear()andconfig::clear_sandbox("default")— mirroring the cleanupsandbox::set(None, ..)already performs.
When the deleted sandbox is the currently active one (tracked via HOTDATA_SANDBOX env var or config.sandbox), clear the cached sandbox session and config pointer so subsequent commands do not keep routing through a stale JWT -- mirrors what sandbox set (no args) already does.
Add check_sandbox_lock() to sandbox::delete for consistency with new, run, and set -- prevents silently deleting the sandbox you are currently running inside.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-o/--outputflag; move "Dataset created" banner to stderr so-o jsonoutput isjq-parseableprintln!instead ofprint!to ensure a trailing newlinesandbox delete <id>subcommand (DELETE /sandboxes/{id})HOTDATA_WORKSPACE(always set in sandbox runs), now correctly checksHOTDATA_SANDBOX; update error messageapi.post()toapi.post_raw()and intercept "not allowed within a session" errors with a helpful hint pointing users tohotdata sandbox set(no args) to clear the active sandbox